package com.design.adapter;

public class MediaAdapter implements MediaPlayer{
    AdvanceMediaPlayer advanceMediaPlayer;

    public MediaAdapter (String audioType){
        if("vlc".equals(audioType)){
            this.advanceMediaPlayer = new VlcPlayer();
        }else if("mp4".equals(audioType)){
            this.advanceMediaPlayer = new Mp4Player();
        }
    }
    @Override
    public void play(String audioType, String fileName) {
        if("vlc".equals(audioType)){
            this.advanceMediaPlayer.playVlc(fileName);
        }else if("mp4".equals(audioType)){
            this.advanceMediaPlayer.playMp4(fileName);
        }
    }
}
